package cn.zyjblogs.starter.common.entity.constant;
/**
 * @author zhuyijun
 */
public class CommonRedisKeyConstant {
    /**
     * 授权码
     */
    public static final  String AUTHORIZATION_CODE = "OAUTH:AUTHORIZATION_CODE";
    /**
     * rsa
     */
    public static final String REDIS_KEY_PRIVATE_RSA = "rsa:key:private_key";
    public static final String REDIS_KEY_PUBLIC_RSA = "rsa:key:public_key";

    /**
     * csrf防护key
     */
    public static final String XSRF_TOKEN = "XSRF_TOKEN:";

    public static final String QR_CODE = "OAUTH:QR_CODE:";
    public static final String CAPTCHA = "OAUTH:CAPTCHA:";
    /**
     * 用于登录验证
     */
    public static final String SMS_LOGIN = "OAUTH:SMS:LOGIN:";
    /**
     * 用于注册
     */
    public static final String SMS_REGISTER = "OAUTH:SMS:REGISTER:";

    private CommonRedisKeyConstant() {
    }

    /**
     * 验证码key获取
     *
     * @param qrsig
     * @param clientId
     * @return
     */
    public static String getQrCodeRediKey(String clientId, String qrsig) {
        return CommonRedisKeyConstant.QR_CODE + clientId + ":" + qrsig;
    }
}